﻿<%dim respagecode%><% 'UTF-8%>

<% ''投诉单管理%>
<% ''加载通用函数和数据库连接%>
<!--#include file="../Include/Start.asp"-->
<%
	dim act ,ksrq_t,jsrq_t  ,strSql,rsObj
	set rsObj=Server.CreateObject("ADODB.Recordset")
	
	''act=ReplaceBadChar(Trim(request("act")))
	ksrq_t=ReplaceBadChar(Trim(request("ksrq_t")))
	jsrq_t=ReplaceBadChar(Trim(request("jsrq_t")))
 	strSql=""
	strSql=strSql & " SELECT COUNT(tt.id) AS 数量, tt.申诉类别 "
	strSql=strSql & " FROM   T_登记单 tt where 1=2  "
	if (""<>ksrq_t or ""<>jsrq_t  ) then 
		strSql=strSql & " or ( 1=1 "
		if (""<>ksrq_t) then strSql=strSql & " and tt.受理时间 >= CONVERT(DATETIME, '"&ksrq_t&" 00:00:00', 102) "
		if (""<>jsrq_t) then strSql=strSql & " and tt.受理时间 <= CONVERT(DATETIME, '"&jsrq_t&" 23:59:59', 102) "
		strSql=strSql & " )"
	end if 
	strSql=strSql & "  GROUP BY tt.申诉类别  "
	strSql=strSql & " ORDER BY   tt.申诉类别"
     
 	''Response.Write strSql&"-----"
 
 
	
	
	''''''''''''输出xml begin'''''''''''''''
Response.ContentType = "text/html"
Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
Response.CodePage = 65001
Response.CharSet = "UTF-8"

Response.BinaryWrite( chrb(239) )
Response.BinaryWrite( chrb(187) )
Response.BinaryWrite( chrb(191) )

''' Now write your XML data to output stream 
	
	
	rsObj.Open strSql, Conn, 1, 3	
	 
Response.Write  "<chart palette='4' caption='投诉类型分析' decimals='0' enableSmartLabels='1' enableRotation='0' bgColor='99CCFF,FFFFFF' bgAlpha='40,100' bgRatio='0,100' bgAngle='360' showBorder='1' startingAngle='0' numbersuffix='件' formatNumberScale='0' decimalPrecision='0' rotateValues='1'>"
	do while not rsObj.eof
		Response.Write "<set label='"&Trim(rsObj("申诉类别"))&"' value='"&Trim(rsObj("数量"))&"' isSliced='1'/>"
	 	rsObj.movenext
		''rsObj.MoveLast
	loop 
 
 
Response.Write  "</chart>"
	''''''''''''输出xml end''''''''''''''' 	
	 
	''关闭链接
	rsObj.close		

	call CloseConn
%>
<!--  
 <chart palette='4' decimals='0' enableSmartLabels='1' enableRotation='0' bgColor='99CCFF,FFFFFF' bgAlpha='40,100' bgRatio='0,100' bgAngle='360' showBorder='1' startingAngle='70'>
 <set label='请问额1312' value='8' isSliced='1'/>
 <set label='asdasdsad' value='8' isSliced='0'/>
 </chart>
-->